package com.swak.persistence.mybatis.methods.impls;

import com.swak.persistence.mybatis.methods.AbstractMethod;
import com.swak.persistence.mybatis.methods.Sqls;

public class Lock extends AbstractMethod {

	@Override
	protected void doInject() {
		if (!this.supportMethod(Sqls.LOCK)) {
			return;
		}
		
		String sql = new StringBuilder().append(SELECT).append(SPACE).append(this.parseSqlColumns()).append(SPACE)
				.append(FROM).append(SPACE).append(this.table.getName()).append(SPACE)
				.append(this.parseWhereLogicDelEqualColumn(false)).append(this.parsePkEqualColumns()).append(SPACE)
				.append(LOCK).toString();

		this.addSelectMappedStatement(Sqls.LOCK.getMethod(), sql);
	}
}